<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/tag/localeTag.tld" prefix="t"%>
<!-- <script type="text/javascript" src="resources/js/addQuestionAnswer.js"></script>
<script type="text/javascript" src="resources/js/feedBackMessage.js"></script> -->
<div class="navigation">
	<div class="row">
		<div class="col-xs-6 text-left">
			<a href="pmain" class="btn btn-info"><t:locale mName="navigation.main" /> <span class="glyphicon glyphicon-home"></span></a> <a href="ptop" class="btn btn-info"><t:locale
					mName="navigation.top"
				/></a> <a href="punanswered" class="btn btn-info"><t:locale mName="navigation.unanswered" /></a> <a href="prandom" class="btn btn-info"><t:locale mName="navigation.random" /></a> <a href="pabout"
				class="btn btn-info"
			><t:locale mName="navigation.aboutUs" /></a>
		</div>
		<div class="col-xs-6 text-right">
			<c:if test="${not empty user && user.roleId==1}">
				<a href="padmin" class="btn btn-warning"><t:locale mName="navigation.showUsers" /></a>
			</c:if>
			<c:choose>
				<c:when test="${not empty user && user.roleId !=1}">
					<button id="popupButton" class="btn btn-info" onclick="feedBackClick()">
						<t:locale mName="navigation.contactUs" />
						<span class="glyphicon glyphicon-envelope"></span>
					</button>
				</c:when>
				<c:when test="${not empty user && user.roleId ==1}">
					<a href="messages" class="btn btn-warning"> <t:locale mName="navigation.messages" /> <span class="glyphicon glyphicon-envelope"></span>
					</a>
				</c:when>
			</c:choose>
			<c:choose>
				<c:when test="${not empty user && user.status == false && user.roleId !=1}">
					<button type="button" class="btn btn-success" onclick="addQuestionClick();">
						<t:locale mName="navigation.addQuestion" />
						<span class="glyphicon glyphicon-pencil"></span>
					</button>
				</c:when>
				<c:when test="${empty user}">
					<button type="button" class="btn btn-success" onclick="$('#loginBox').show();">
						<t:locale mName="navigation.addQuestion" />
						<span class="glyphicon glyphicon-pencil"></span>
					</button>
				</c:when>
			</c:choose>
		</div>
	</div>
	<form class="form-horizontal" method="POST" action="addQuestion">
		<div id="addQuestion">
			<div class="form-group">
				<div class="col-xs-6">
					<h2>
						<t:locale mName="navigation.newQuestion" />
					</h2>
				</div>
				<div class="col-xs-6 text-right">
					<span onclick="addQuestionClose()" class="glyphicon glyphicon-remove"></span>
				</div>
			</div>
			<div class="form-group">
				<label for="categoryId">
					<t:locale mName="navigation.chooseQuestionCategory" />
				</label>
				<select class="form-control" name="categoryId" id="categoryId">
					<c:forEach items="${categories}" var="categ">
						<option value="${categ.id}">${categ.name}</option>
					</c:forEach>
				</select>
			</div>
			<div class="form-group">
				<label for="questionTitle">
					<t:locale mName="navigation.questionTitle" />
				</label>
				<input type="text" class="form-control" id="questionTitle" name="questionTitle" placeholder="<t:locale mName="navigation.questionTitle"/>" required="required">
			</div>
			<div class="form-group">
				<label for="questionText">
					<t:locale mName="navigation.inputQuestion" />
				</label>
				<textarea id="questionText" name="questionText" id="questionText" class="form-control nonResizable" rows="4" required="required"></textarea>
			</div>
			<div class="form-group">
				<div class="col-xs-6">
					<input type="submit" class="btn btn-info" value="<t:locale mName="navigation.addNewQuestion"/>">
				</div>
				<div class="col-xs-6 text-right">
					<input type="button" class="btn btn-info" value="<t:locale mName="navigation.addCode"/>" onclick="addCodeToQuestion()">
				</div>
			</div>
		</div>
	</form>
	<div id="parent_popup"></div>
	<div id="feedBack">
		<form action="contactUs" method="POST">
			<div class="row">
				<div class="col-xs-9">
					<h4>
						<t:locale mName="navigation.contactUs" />
					</h4>
				</div>
				<div class="col-xs-3 text-right">
					<span onclick="feedBackClose();" class="glyphicon glyphicon-remove"></span>
				</div>
			</div>
			<div class="form-group">
				<label for="msg">
					<t:locale mName="message.enterMessage" />
				</label>
				<textarea name="msg" placeholder='<t:locale mName="messages.message"/>' class="form-control nonResizable" rows="4" id="msg" required="required"></textarea>
			</div>
			<div>
				<button type="submit" class="btn btn-info" id="submitSend">
					<t:locale mName="message.send" />
				</button>
			</div>
		</form>
	</div>
</div>
